/**
 * User: ShenBo
 * Created on: 2009-5-29, 19:47:18
 */

package shenbo.fetionlib;

import junit.framework.TestCase;

import java.io.IOException;
import java.util.PropertyResourceBundle;

public class BaseTestCase extends TestCase {

    public FetionAccount getTestAccount() throws IOException {
        PropertyResourceBundle rb = new PropertyResourceBundle(BaseTestCase.class.getClassLoader().getResourceAsStream("shenbo/fetionlib/testAccount.properties"));

        for (String key : rb.keySet()) {
            String value = rb.getString(key);
            System.setProperty(key, value);
        }

        String mobileNo = System.getProperty("shenbo.fetionlib.testAccount.MobileNo");
        String password = System.getProperty("shenbo.fetionlib.testAccount.Password");

        return new FetionAccount(mobileNo, password, FetionAccount.AccountType.MobileNo);
    }
}
